<?php
namespace app\index\controller;

use app\common\utils\ResultVOUtil;
use app\common\service\AgencyService;
use app\common\enums\ResultEnum;

class Agency extends Base{
    
    protected $agencyService;
    
    public function __construct(AgencyService $agencyService)
    {
        parent::initialize();
        $this->agencyService = $agencyService;
    }
    
    public function queryAll(){
        $data = $this->agencyService->queryAll();
       if($data){
           return ResultVOUtil::success($data);
       }else{
           return ResultVOUtil::error(ResultEnum::FIND_ERROR);
       }
    }
}